const Mock = require('mockjs')
// 获取 mock.Random 对象
const Random = Mock.Random
// mock一组数据
const produceData = function (opt) {
  console.log('opt', opt)
  let sample = []
  for (let i = 1; i < 30; i++) {
    let newSample = {
      sampleID: Random.id(),
      reportID: Random.id(),
      type: Random.cword(2),
      name: Random.cname(),
      collector: Random.cname(),
      collectionTime: Random.date(),
      bearer: Random.cname(),
      deliveryTime: Random.date(),
      telephone: Random.guid(),
      character: Random.csentence(2),
      specification: Random.csentence(2),
      remarks: Random.csentence(2)
    }
    sample.push(newSample)
  }
  return {
    data: sample
  }
}

Mock.mock('/news', /post|get/i, produceData)
